using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Runtime.Serialization;

namespace DIS_DAO.DTO
{
	/// <summary>
	/// Data transfer object which is associated with Cart table in database
	/// </summary>
	public class CartDTO
	{
		public int RecordId { get; set; }
		public int ItemID { get; set; }
		public string CartId { get; set; }
		public int Count { get; set; }
		public DateTime DateCreated { get; set; }

		public static CartDTO Translate(DataRow row)
		{
			var dto = new CartDTO
			{
				RecordId = int.Parse(row["RecordId"].ToString()),
				ItemID = int.Parse(row["ItemID"].ToString()),
				CartId = row["CartId"].ToString(),
				Count = int.Parse(row["Count"].ToString()),
				DateCreated = DateTime.Parse(row["DateCreated"].ToString()),
			};
			return dto;
		}
	}
}